package com.pcbly.web.components.utils.converters;

import java.math.BigInteger;

import org.apache.commons.beanutils.Converter;
import org.apache.commons.beanutils.converters.BigIntegerConverter;

public class MyBigIntegerConverter implements Converter {
	public MyBigIntegerConverter() {

	}

	private static BigInteger newDefaultBigInteger() {
		return new BigInteger("0");
	}
	@SuppressWarnings("unchecked")
	public Object convert(Class type, Object value) {
		if (type.equals(java.math.BigInteger.class) && value == null)
			return newDefaultBigInteger();
		else
			return (new BigIntegerConverter()).convert(type, value);
	}

}
